package com.gitee.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Data
public class CookbookBo {

    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "用餐时间不能为空")
    private Date eatTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "订餐截止时间不能为空")
    private Date endTime;

    @NotNull(message = "菜品预订上限不能为空")
    private Integer maxNum;

    @NotNull(message = "菜品预订上限不能为空")
    private Integer cookbookType;

    @NotEmpty(message = "菜品不能为空")
    private List<FoodStock> foodStockList;

    @Data
    public static class FoodStock {

        private Integer id;

        private String title;

        private Integer stockNum;
    }
}
